// 源插件
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { DateDiff, FormatnumberZero, Mover, NumberDivide } from '@/function.js';
// 视图插件
import { Form, Modal } from 'antd';
// 外部组件
import PositionRuiOptionsModalTable from './PositionRuiOptionsModalTable';
// css OR less预编译器

// 图片

// 算式

/**
 *  Created by xjc on 2019/5/15
 *  Describe:数据连接
 */

@connect(({ positionrui, loading }) => ({
  positionrui,
  loading: loading.models.positionruiRule,
}))
@Form.create()
class PositionRuiOptionsModal extends PureComponent {
  componentWillMount() {}

  /**
   *  Created by xjc on 2019/5/15
   *  Describe:当前状态
   */

  state = {
    listLoading: false, // 加载状态
    selectedRows: [], // 选择行
    formValues: {
      num: 10,
      page: 1,
    }, // 表格参数
    record: {}, // 当前行内容
    searchText: '', // 搜索内容
    columns: [], // 表头处理结果
  };

  cancelHandle() {
    this.props.closeOption();
  }

  /**
   *  Created by xjc on 2019/5/15
   *  Describe:视图
   */

  render() {
    const { OptionVisible, record } = this.props;
    return (
      <Modal
        width="90%"
        destroyOnClose
        title="查看期权"
        visible={OptionVisible}
        centered
        onOk={this.cancelHandle.bind(this)}
        onCancel={this.cancelHandle.bind(this)}
      >
        <PositionRuiOptionsModalTable stock={record.stock} />
      </Modal>
    );
  }

  componentDidMount() {}

  componentWillUnmount() {}
}

export default PositionRuiOptionsModal;
